<?	

function tags_user_showTagCloud($data) {
	
	global $CURRENT;
	
	foreach ($data as $k => $v)
		if ($v['attr'] & AA_VISIBLE) {				// tag is visible
			if ($v['attr'] & AA_SELECTABLE) {		// tag can be selected
				if ($v['filter']['active']) {						// tag isn't filtered out
					if ($v['filter']['selected']) {						// tag isn't filtered out
						?><li><strong><?=$v['name']?></strong> <?
					} else {
						?><li><a href="<?=_transformURL($CURRENT->url, array('remove_param' => 'tag','add_param' => "tag:$v[id]"))?>"><?=$v['name']?></a> <?
					}
				} else {
					?><li><span><?=$v['name']?></span> <?
				}
			} else {
				?><li><span><?=$v['name']?></span> <?
			}
			
			if($v['data']) {
				?><ul><?	tags_user_showTagCloud($v['data']) ?></ul><?
			}
			?></li><?
		}
}

if (sizeof($DATA['tags'])) {
	tags_user_showTagCloud($DATA['tags']);
}

?>